package com.smart.manager.member.controller;

import cn.dev33.satoken.annotation.SaCheckPermission;
import com.smart.common.entities.ajax.AjaxResult;
import com.smart.common.entities.constant.ArcoTips;
import com.smart.common.entities.constant.SmartConstant;
import com.smart.common.entities.core.Page;
import com.smart.manager.member.entities.bodys.RMemberMaterialPig;
import com.smart.manager.member.entities.models.MemberMaterialPig;
import com.smart.manager.member.repository.MemberMaterialPigRepository;
import com.smart.manager.member.repository.MemberMaterialPigRepository;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotEmpty;
import java.util.List;


/**
 * @author leo
 * @date 2023/09/22
 */
@Api(tags = "玩家猪猪")
@RestController
@RequestMapping(SmartConstant.MANAGER_API_PREFIX + "member/material/pig")
@RequiredArgsConstructor
public class MaterialPigApi {
    private final MemberMaterialPigRepository memberMaterialPigRepository;

    @GetMapping(value = "pageList")
    @ApiOperation(value = "查询猪猪")
    @SaCheckPermission("member:material:pig:pageList")
    public AjaxResult<Page<MemberMaterialPig>> pageList(@Validated RMemberMaterialPig.SearchBody body) {
        Page<MemberMaterialPig> result = memberMaterialPigRepository.pageList(body);
        return AjaxResult.data(result);
    }

}
